package com.yf.dxs.wo.req.msg;

import cn.hutool.core.date.DateTime;
import com.yf.dxs.wo.entity.WoOrderMsgDO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 订单通知
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WoOrderMsg {

    private int orderType;
    private int orderSource;
    private long orderNo;
    private int[] discountTypes;
    private int productId;
    private int deliveryType;
    private long productInstanceId;
    private int orderStatus;
    private int channelType;
    private long updateTime;
    private long parentOrderNo;
    private int saleChannelType;
    private int paymentType;
    private long vid;
    private long wid;
    private long createTime;
    private long merchantId;
    private long bosId;
    private int bizSourceType;
    private int paymentStatus;

    public WoOrderMsgDO toEntity(){
        WoOrderMsgDO woOrderEntity = new WoOrderMsgDO();
        woOrderEntity.setOrderNo(orderNo);
        woOrderEntity.setOrderSource(orderSource);
        woOrderEntity.setOrderStatus(orderStatus);
        woOrderEntity.setOrderType(orderType);
        woOrderEntity.setWid(wid);
        woOrderEntity.setCreateTime(new DateTime(createTime));
        woOrderEntity.setDeliveryType(deliveryType);
        woOrderEntity.setPaymentType(paymentType);
        woOrderEntity.setPaymentStatus(paymentStatus);
        woOrderEntity.setUpdateTime(new Date(updateTime));
        return woOrderEntity;
    }

}
